package org.child_motivation.business.service;

import org.child_motivation.business.model.PersonalTask;
import org.child_motivation.business.model.Task;
import org.child_motivation.business.model.TaskForApproval;
import org.child_motivation.integration.dao.TaskDao;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class DefaultTaskService implements TaskService {
    @Autowired
    TaskDao taskDao;

    @Override
    public void saveOrUpdate(Task task) {
       taskDao.saveOrUpdate(task);
    }

    @Override
    public List<Task> getAllTasks() {
        return taskDao.getAllDefaultTasks();
    }

    @Override
    public void saveOrUpdate(PersonalTask task) {
        taskDao.saveOrUpdate(task);
    }

    @Override
    public List<PersonalTask> getTaskForGroup(int groupid) {
        return taskDao.getTaskForGroup(groupid);
    }

    @Override
    public void saveOrUpdate(TaskForApproval task) {
        taskDao.saveOrUpdate(task);

    }

    @Override
    public List<TaskForApproval> getApprovalTasksForGroup(int groupid) {
        return taskDao.getApprovalTasksForGroup(groupid);
    }
}
